import vue from "vue";
import VueRouter from "vue-router";
vue.use(VueRouter);
const routes = [
  { path: "/", component: () => import('@/views/DashBord') },
  {
    path: '/daily',
    name: "daily",
    component: () => import('@/views/daily'),
    children: [
      {
        path: "/",
        redirect: "link",
      },
      {
        path: "css",
        name: "CssView",
        component: () => import("@/views/daily/cssview")
      },
      {
        path: "vue",
        name: "vueView",
        component: () => import("@/views/daily/vueview")
      },
      {
        path: "component",
        name: "ComponentView",
        component: () => import("@/views/daily/componentview"),
        children: [
          {
            path: "/",
            redirect: "scrollview",
          },
          {
            path:"scrollview",
            name:"scrollview",
            component: () => import("@/views/daily/componentview/ScrollView.vue")
          },
          {
            path:"tree",
            name:"tree",
            component: () => import("@/views/daily/componentview/Tree")
          }
        ]
      },
      {
        path: "link",
        name: "LinkView",
        component: () => import("@/views/daily/linkview")
      },
      {
        path: "exercises",
        name: "exercises",
        component: () => import("@/views/daily/exercises")
      },
      {
        path: "jianli",
        name: "jianli",
        component: () => import("@/views/daily/jianli")
      }
    ]
  },
  {
    path: "/login",
    name: "login",
    component: () => import('@/views/login')
  },
  {// 登录成功后跳转到school页面
    path: "/school",
    name: "school",
    component: () => import('@/views/login/school')
  },
  {
    path: "/other",
    name: "Other",
    component: () => import('@/views/other')
  },
  { path: "*", component: () => import('@/views/DashBord') }
]
// 实例化路由
export default new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})